function isIdCardNo(num) {
	if (isNaN(num)) {
		alert("输入的身份证不是数字！");
		return false;
	}
	
	var len = num.length, re; 
	if (len == 15)
		re = new RegExp("/^(\d{6})()?(\d{2})(\d{2})(\d{2})(\d{3})$/");
	else if (len == 18)
		re = new RegExp("/^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\d)$/");
	else {
		alert("输入的身份证数字位数不对！");
		return false;
	}

	var a = num.match(re);
	if (a != null) {
		if (len==15) {
			var D = new Date("19"+a[3]+"/"+a[4]+"/"+a[5]);
			var B = D.getYear()==a[3]&&(D.getMonth()+1)==a[4]&&D.getDate()==a[5];
		} else {
			var D = new Date(a[3]+"/"+a[4]+"/"+a[5]);
			var B = D.getFullYear()==a[3]&&(D.getMonth()+1)==a[4]&&D.getDate()==a[5];
		}
		if (!B) {alert("输入的身份证号 "+ a[0] +" 里出生日期不对！"); return false;}
	}

	return true;
}

function isCellPhone(num) {
	return (num.search(/^0{0,1}13[0-9]{9}$/) != -1);
}

function isPhone(num) {
	return (num.search(/^(\d{3,4}-)?\d{7,8}$/) != -1);
}

function isZipCode(num) {
	return (num.search(/^\d{6}$/) != -1);
}

function trim(str)
{
	str=str.replace(/^\s+/,"");
	str=str.replace(/\s+$/,"");
	return str;
}

function isEmpty(str)
{
	return (trim(str).length==0);
}

function isInteger(str)
{
	return (str.search(/^\d+$/)!=-1);
}

function isCellphoneNumber(str)
{
  return isInteger(str)&&(str.length==11);	
}

function isEmail(a)
{
	var i=a.length;
	var temp = a.indexOf('@');
	var tempd = a.indexOf('.');
	if (temp > 1)
	{
		if ((i-temp) > 3)
		{
			if ((i-tempd)>0)
			{
				return true;
			}
		}
	}
	return false;
}